<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>变量</title>
    <script>
        let name1 = 1
        let name2 = "你好"
        let bianliang_name_rule = "一般来说，变量、属性是首字母小写，后面大写，也可以用下划线隔开"
        let bianliang_name_rule2 = "函数、类字母全部大写"
        let bianliang_name_rule3 = "变量大小写敏感"

        document.write(bianliang_name_rule)
        document.write(bianliang_name_rule2)
        document.write(bianliang_name_rule3)
        // document.write(Bianliang_name_rule3)
        //执行报错之后，后面的代码都不执行了
        class People{

        }
        function CountPeople(){

        }

        //变量可以不定义初始值，这个时候值为undefined
        let user1 
        let caiPeiYan = 25
        /*
        这个是多行注释
        document.write(user1)
        document.write(caiPeiYan)

        */
        console.log(user1)
        console.log(caiPeiYan)

        caiPeiYan = "帅哥"
        console.log(caiPeiYan)
        console.log(typeof'1')
        //对变量重新赋值，改变变量的指向
        let coolBoy = "小明"
        primaryStudent = coolBoy
        talentedBoy = coolBoy
        console.log(talentedBoy)
        console.log("变更talentedBoy的指向")
        talentedBoy = "caipeiyan"
        console.log(talentedBoy)
        console.log(primaryStudent)


        let var1 = 1
        copy_of_var1 = var1
        var1 = var1 + 1
        //这个时候var1 = 2 、copy_of_var1 = 1
        console.log(var1)
        console.log(copy_of_var1)

        //对于可变数据类型 数组、objects 可以通过变量名改变其内容
        let array1 = {name : "caipeiyan", age : "25", hobby : "篮球"}
        console.log(array1)
        array1.hobby = "游戏"
        console.log(array1)
        console.log("-------------")
        //num2=2    num3=4   num1=5  copy_of_num1 = 2
        let num1 = 2
        let copy_of_num1 = num1
        let num2 = num1++
        let num3 = ++num1
        num1 += 1
        console.log(num1)
        console.log(num2)
        console.log(num3)
        console.log(copy_of_num1)
    </script>
</head>
<body>
    <br>
    这是空的html，看控制台

</body>


</html>